package ocean.chinacraft.common.world.item;

import net.minecraft.util.ResourceLocation;
import net.minecraft.util.SoundEvent;
import net.minecraftforge.eventbus.api.IEventBus;
import net.minecraftforge.fml.RegistryObject;
import net.minecraftforge.registries.DeferredRegister;
import net.minecraftforge.registries.ForgeRegistries;
import ocean.chinacraft.common.constants.Constants;

/**
 * 声音
 *
 * @author zhang
 * @since 2021/12/24
 */
public class ModSounds {

    public static final DeferredRegister<SoundEvent> SOUND_EVENT =
            DeferredRegister.create(ForgeRegistries.SOUND_EVENTS, Constants.MOD_ID);


    public static final RegistryObject<SoundEvent>  FIRE_CRACKER = registrySoundEvent("fire_cracker");

    private static RegistryObject<SoundEvent> registrySoundEvent(String name) {
        return SOUND_EVENT.register(name, () -> new SoundEvent(new ResourceLocation(Constants.MOD_ID,
                name)));
    }

    public static void register(IEventBus bus) {
        SOUND_EVENT.register(bus);
    }
}
